package com.huluobo.a2109kotlinshopping

import android.app.Application
import com.huluobo.a2109kotlinshopping.db.DatabaseUtil
import com.hyphenate.chat.EMClient
import com.hyphenate.chat.EMOptions
import com.hyphenate.easeui.EaseIM


/**
 *  Created by LC on 2024/1/12.
 */
class ShopApp : Application() {
    override fun onCreate() {
        super.onCreate()
        //初始化数据库
        DatabaseUtil.init(this)

        val options = EMOptions()
        options.appKey = "moroks#2109kotlinshopping"
        //EaseIM 初始化
        if (EaseIM.getInstance().init(this, options)) {
            //在做打包混淆时，关闭 debug 模式，避免消耗不必要的资源
            EMClient.getInstance().setDebugMode(true);
            //EaseIM 初始化成功之后再调用注册消息监听的代码 ...
        }
    }
}